api client server design